from django.conf.urls import url
from Blog.views import *
from django.views.generic import TemplateView, DetailView
from Blog.models import News

urlpatterns = [
        url(r'^index.html$', IndexView.as_view(), name='index-view'),
        url(r'^article/(?P<slug>\w+).html$',
            ArticleView.as_view(), name='article-detail-view'),
        url(r'^all/$', AllView.as_view(), name='all-view'),
        url(r'^comment/(?P<slug>\w+)$', CommentControl.as_view()),
        url(r'^search/$', SearchView.as_view()),
        # url(r'^login/$',
        #     TemplateView.as_view(template_name="blog/login.html"),
        #     name='login-view'),
        # url(r'^register/$',
        #     TemplateView.as_view(template_name="blog/register.html"),
        #     name='register-view'),
        # url(r'^forgetpassword/$',
        #     TemplateView.as_view(template_name="blog/forgetpassword.html"),
        #     name='forgetpassword-view'),
        # url(r'^resetpassword/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
        #     TemplateView.as_view(template_name="blog/resetpassword.html"),
        #     name='resetpassword-view'),
        url(r'^user/(?P<slug>\w+)$', UserView.as_view(), name='user-view'),
        url(r'^usercontrol/(?P<slug>\w+)$', UserControl.as_view()),

        url(r'^column.html',
            ColumnView),
        #  
        url(r'^news/$', NewsView.as_view(), name='news-view'),
        url(r'^news/(?P<pk>\w+)$',
            DetailView.as_view(model=News), name='news-detail-view'),
        url(r'^tag/(?P<tag>.+)/$', TagView.as_view(), name='tag-detail-view'),
        url(r'^category/(?P<category>\w+)/$',
            CategoryView.as_view(), name='category-detail-view'),

        url(r'^publish.html$',
            Publish.as_view(), name='publish-detail-view'),
        url(r'^userarticle.html$',
            UserArticle.as_view(), name='publish-detail-view'),
        url(r'^peer_response.html$', PeerResponse),
]
